package com.huawei.appgallery.search.ui.card;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import com.huawei.appgallery.foundation.card.base.card.BaseDistCard;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.search.ui.cardbean.SearchCorrectCardBean;
import huawei.widget.HwButton;
import huawei.widget.HwTextView;
import java.util.ArrayList;
import o.cgz;
import o.chy;
import o.cuv.b;
import o.dyk;
import o.evx;

public class SearchCorrectCard extends BaseDistCard {
    private HwTextView ˋ;
    private HwButton ॱॱ;

    public SearchCorrectCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        this.ˋ = (HwTextView) view.findViewById(b.ˊॱ);
        this.ॱॱ = (HwButton) view.findViewById(b.ˋॱ);
        ʽ(view);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if ((cardBean instanceof SearchCorrectCardBean) && this.ˋ != null && this.ॱॱ != null) {
            SearchCorrectCardBean searchCorrectCardBean = (SearchCorrectCardBean) cardBean;
            this.ˋ.setText(searchCorrectCardBean.ʽ());
            this.ॱॱ.setText(searchCorrectCardBean.ˊ());
        }
    }

    public void ॱ(final chy o_chy) {
        if (o_chy != null && this.ॱॱ != null) {
            this.ॱॱ.setOnClickListener(new evx(this) {
                final /* synthetic */ SearchCorrectCard ˏ;

                public void ˋ(View view) {
                    o_chy.ˏ(7, this.ˏ);
                    if (this.ˏ.ˌ() instanceof SearchCorrectCardBean) {
                        SearchCorrectCardBean searchCorrectCardBean = (SearchCorrectCardBean) this.ˏ.ˌ();
                        dyk.ॱ(this.ˏ.ˉ().getContext(), searchCorrectCardBean.ॱˉ(), searchCorrectCardBean.ॱॱ());
                    }
                }
            });
        }
    }

    public ArrayList<String> ˋ() {
        if (!(ˌ() instanceof SearchCorrectCardBean)) {
            return new ArrayList();
        }
        SearchCorrectCardBean searchCorrectCardBean = (SearchCorrectCardBean) ˌ();
        ArrayList<String> arrayList = new ArrayList();
        if (!TextUtils.isEmpty(searchCorrectCardBean.ॱॱ())) {
            arrayList.add(searchCorrectCardBean.ॱॱ());
        }
        return arrayList;
    }
}
